#include <stdio.h>
#include <string.h>

int main()
{
	char *s1 = "abcd";	//只读区
	char s2[] = "abcd";	//栈区
	char *s3 = s2;		//栈区
	printf("s1 = %p\n", s1);
	s1 = "1234";		//只读区可以改地址
	printf("s1 = %p\n", s1);
	printf("s2 = %p\n", s2);	
//	printf("s3 = %p\n", s3);	
//	strcpy(s3,"ABCDE");
//	*s3 = 'c';
	printf("%s\n",s3);
//	s2 = "1234";		//error，常指针（字符数组）不能直接赋值
	s3 = "1234";		//只读区可以改地址
//	strcpy(s1, "A");	//error，只读区不能修改内容
//	s1[0] = 'A';		//error，只读区不能修改内容
	strcpy(s2, "ABCD");
//	strcpy(s3, "ABCD"); //error，s3指向s1的地址，即只读区；
						  //若要改值，将其指向只读区，即s3 = s2;
	printf("s3 = %p\n", s3);

	const char * p = "qwer";
	++p;
	printf("%s\n",p);
	return 0;
}
